﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using VK.Comm;

namespace VK.Casemeet.Areas
{
    public class AreaHelper
    {
        public static void BindAreaDDL(DropDownList control, OptionType optionType, int? areaID)
        {
            control.Items.Clear();
            control.DataSource = AreaBLL.GetAreaStyleArray(0, true, areaID);
            control.DataTextField = "Name";
            control.DataValueField = "AreaID";
            control.DataBind();
            switch (optionType)
            {
                case OptionType.Default: break;
                case OptionType.Search: control.Items.Insert(0, new ListItem("全部", "0")); break;
                case OptionType.Select: control.Items.Insert(0, new ListItem("请选择", "0")); break;
            }
            control.SelectedIndex = 0;
        }
    }
}
